package com.luoyi.util.ehr;

import cn.hutool.core.util.StrUtil;
import com.alibaba.fastjson2.JSON;
import com.alibaba.fastjson2.JSONArray;
import com.alibaba.fastjson2.JSONObject;

import java.util.HashMap;
import java.util.Map;

/**
 * 人力共享平台 145配置表 insert sql生成
 *
 * @author xt
 */
public class Ehr145TableGenerate {

    // 字段配置
    public static JSONObject[] allJson = {
            // 教育经历
            JSON.parseObject("{\"INFTY\":\"0022\",\"SUBTY\":\"\",\"INFTX\":\"教育经历(请从高中教育经历开始填起)\",\"SORTD\":\"05\",\"ACTIO\":\"INS\",\"ZZREQ\":\"X\",\"ZZTAB\":\"X\",\"ZZLST\":\"\",\"XXCOL\":4,\"BSFLD\":\"EDUCATION_BACKGROUND\",\"FIELD\":[{\"FIELD\":\"F1260\",\"FIELN\":\"开始时间\",\"SORTD\":\"05\",\"ZZREQ\":\"X\",\"ZZHID\":\"\",\"ZZDEF\":\"\",\"ZZSHF\":\"\",\"ZZSHN\":\"\",\"ZZSHM\":\"\",\"ZZZJL\":\"\",\"ZZKEY\":\"\",\"ZKJLX\":\"IPT\",\"ZSKEY\":\"\",\"ZSVAL\":\"\",\"ZSCOD\":\"\",\"CFIED\":\"\",\"RFIED\":\"ZHRJYKSRQ\",\"ZZBDS\":\"\",\"FTYPE\":\"D\",\"FLENG\":8,\"FDECI\":\"000000\",\"ZZDIS\":\"\",\"ZZCOL\":1,\"RCODE\":\"\",\"ZZDQZ\":\"\",\"ZIFXG\":\"\",\"EVEN\":\"\",\"FFIED\":\"\",\"ZSSQZ\":\"\",\"OFFLD\":\"\",\"BSFLD\":\"STARTDATE\",\"ZRC_TYPE\":\"\",\"ZTSGD\":\"\"},{\"FIELD\":\"F1265\",\"FIELN\":\"结束时间\",\"SORTD\":\"10\",\"ZZREQ\":\"X\",\"ZZHID\":\"\",\"ZZDEF\":\"\",\"ZZSHF\":\"\",\"ZZSHN\":\"\",\"ZZSHM\":\"\",\"ZZZJL\":\"\",\"ZZKEY\":\"\",\"ZKJLX\":\"IPT\",\"ZSKEY\":\"\",\"ZSVAL\":\"\",\"ZSCOD\":\"\",\"CFIED\":\"\",\"RFIED\":\"ZHRJYJSRQ\",\"ZZBDS\":\"\",\"FTYPE\":\"D\",\"FLENG\":8,\"FDECI\":\"000000\",\"ZZDIS\":\"\",\"ZZCOL\":1,\"RCODE\":\"\",\"ZZDQZ\":\"\",\"ZIFXG\":\"\",\"EVEN\":\"\",\"FFIED\":\"\",\"ZSSQZ\":\"\",\"OFFLD\":\"\",\"BSFLD\":\"ENDDATE\",\"ZRC_TYPE\":\"\",\"ZTSGD\":\"\"},{\"FIELD\":\"F1275\",\"FIELN\":\"学历\",\"SORTD\":\"15\",\"ZZREQ\":\"X\",\"ZZHID\":\"\",\"ZZDEF\":\"\",\"ZZSHF\":\"T\",\"ZZSHN\":\"T517T\",\"ZZSHM\":\"D\",\"ZZZJL\":\"\",\"ZZKEY\":\"\",\"ZKJLX\":\"IPT\",\"ZSKEY\":\"SLART\",\"ZSVAL\":\"STEXT\",\"ZSCOD\":\"SPRSL=&LANGU\",\"CFIED\":\"\",\"RFIED\":\"SLART\",\"ZZBDS\":\"\",\"FTYPE\":\"S\",\"FLENG\":0,\"FDECI\":\"000000\",\"ZZDIS\":\"\",\"ZZCOL\":1,\"RCODE\":\"\",\"ZZDQZ\":\"\",\"ZIFXG\":\"\",\"EVEN\":\"\",\"FFIED\":\"\",\"ZSSQZ\":\"\",\"OFFLD\":\"\",\"BSFLD\":\"P0022_SLART\",\"ZRC_TYPE\":\"Education\",\"ZTSGD\":\"\"},{\"FIELD\":\"F1270\",\"FIELN\":\"学校\",\"SORTD\":\"20\",\"ZZREQ\":\"X\",\"ZZHID\":\"\",\"ZZDEF\":\"\",\"ZZSHF\":\"\",\"ZZSHN\":\"\",\"ZZSHM\":\"\",\"ZZZJL\":\"\",\"ZZKEY\":\"\",\"ZKJLX\":\"IPT\",\"ZSKEY\":\"\",\"ZSVAL\":\"\",\"ZSCOD\":\"\",\"CFIED\":\"\",\"RFIED\":\"INSTI\",\"ZZBDS\":\"\",\"FTYPE\":\"C\",\"FLENG\":80,\"FDECI\":\"000000\",\"ZZDIS\":\"\",\"ZZCOL\":1,\"RCODE\":\"\",\"ZZDQZ\":\"\",\"ZIFXG\":\"\",\"EVEN\":\"\",\"FFIED\":\"\",\"ZSSQZ\":\"\",\"OFFLD\":\"\",\"BSFLD\":\"P0022_INSTI\",\"ZRC_TYPE\":\"\",\"ZTSGD\":\"\"},{\"FIELD\":\"F1276\",\"FIELN\":\"是否最高学历\",\"SORTD\":\"26\",\"ZZREQ\":\"X\",\"ZZHID\":\"\",\"ZZDEF\":\"\",\"ZZSHF\":\"D\",\"ZZSHN\":\"ZDHR_XFELD\",\"ZZSHM\":\"D\",\"ZZZJL\":\"\",\"ZZKEY\":\"\",\"ZKJLX\":\"IPT\",\"ZSKEY\":\"\",\"ZSVAL\":\"\",\"ZSCOD\":\"\",\"CFIED\":\"\",\"RFIED\":\"ZHRSFZGXL\",\"ZZBDS\":\"\",\"FTYPE\":\"S\",\"FLENG\":0,\"FDECI\":\"000000\",\"ZZDIS\":\"\",\"ZZCOL\":1,\"RCODE\":\"\",\"ZZDQZ\":\"\",\"ZIFXG\":\"\",\"EVEN\":\"\",\"FFIED\":\"\",\"ZSSQZ\":\"\",\"OFFLD\":\"\",\"BSFLD\":\"\",\"ZRC_TYPE\":\"\",\"ZTSGD\":\"\"},{\"FIELD\":\"F1277\",\"FIELN\":\"是否最高学位\",\"SORTD\":\"27\",\"ZZREQ\":\"X\",\"ZZHID\":\"\",\"ZZDEF\":\"\",\"ZZSHF\":\"D\",\"ZZSHN\":\"ZDHR_XFELD\",\"ZZSHM\":\"D\",\"ZZZJL\":\"\",\"ZZKEY\":\"\",\"ZKJLX\":\"IPT\",\"ZSKEY\":\"\",\"ZSVAL\":\"\",\"ZSCOD\":\"\",\"CFIED\":\"\",\"RFIED\":\"ZHRZGXW\",\"ZZBDS\":\"\",\"FTYPE\":\"S\",\"FLENG\":0,\"FDECI\":\"000000\",\"ZZDIS\":\"\",\"ZZCOL\":1,\"RCODE\":\"\",\"ZZDQZ\":\"\",\"ZIFXG\":\"\",\"EVEN\":\"\",\"FFIED\":\"\",\"ZSSQZ\":\"\",\"OFFLD\":\"\",\"BSFLD\":\"\",\"ZRC_TYPE\":\"\",\"ZTSGD\":\"\"},{\"FIELD\":\"F1278\",\"FIELN\":\"是否初始学历\",\"SORTD\":\"28\",\"ZZREQ\":\"X\",\"ZZHID\":\"\",\"ZZDEF\":\"\",\"ZZSHF\":\"D\",\"ZZSHN\":\"ZDHR_XFELD\",\"ZZSHM\":\"D\",\"ZZZJL\":\"\",\"ZZKEY\":\"\",\"ZKJLX\":\"IPT\",\"ZSKEY\":\"\",\"ZSVAL\":\"\",\"ZSCOD\":\"\",\"CFIED\":\"\",\"RFIED\":\"ZHRCSXL\",\"ZZBDS\":\"\",\"FTYPE\":\"S\",\"FLENG\":0,\"FDECI\":\"000000\",\"ZZDIS\":\"\",\"ZZCOL\":1,\"RCODE\":\"\",\"ZZDQZ\":\"\",\"ZIFXG\":\"\",\"EVEN\":\"\",\"FFIED\":\"\",\"ZSSQZ\":\"\",\"OFFLD\":\"\",\"BSFLD\":\"\",\"ZRC_TYPE\":\"\",\"ZTSGD\":\"\"},{\"FIELD\":\"F1280\",\"FIELN\":\"专业类别\",\"SORTD\":\"30\",\"ZZREQ\":\"X\",\"ZZHID\":\"\",\"ZZDEF\":\"\",\"ZZSHF\":\"T\",\"ZZSHN\":\"ZHRZYLBB\",\"ZZSHM\":\"D\",\"ZZZJL\":\"\",\"ZZKEY\":\"\",\"ZKJLX\":\"IPT\",\"ZSKEY\":\"ZHRZYLB\",\"ZSVAL\":\"ZHRZYLBMC\",\"ZSCOD\":\"\",\"CFIED\":\"\",\"RFIED\":\"ZHRZYLB\",\"ZZBDS\":\"\",\"FTYPE\":\"S\",\"FLENG\":0,\"FDECI\":\"000000\",\"ZZDIS\":\"\",\"ZZCOL\":1,\"RCODE\":\"\",\"ZZDQZ\":\"\",\"ZIFXG\":\"\",\"EVEN\":\"\",\"FFIED\":\"\",\"ZSSQZ\":\"\",\"OFFLD\":\"\",\"BSFLD\":\"ZYLB\",\"ZRC_TYPE\":\"ZHRZYLB\",\"ZTSGD\":\"\"},{\"FIELD\":\"F1285\",\"FIELN\":\"专业名称（初中以上必填）\",\"SORTD\":\"35\",\"ZZREQ\":\"\",\"ZZHID\":\"\",\"ZZDEF\":\"\",\"ZZSHF\":\"\",\"ZZSHN\":\"\",\"ZZSHM\":\"\",\"ZZZJL\":\"\",\"ZZKEY\":\"\",\"ZKJLX\":\"IPT\",\"ZSKEY\":\"\",\"ZSVAL\":\"\",\"ZSCOD\":\"\",\"CFIED\":\"\",\"RFIED\":\"ZHRSXZY\",\"ZZBDS\":\"\",\"FTYPE\":\"C\",\"FLENG\":40,\"FDECI\":\"000000\",\"ZZDIS\":\"\",\"ZZCOL\":1,\"RCODE\":\"\",\"ZZDQZ\":\"\",\"ZIFXG\":\"\",\"EVEN\":\"\",\"FFIED\":\"\",\"ZSSQZ\":\"\",\"OFFLD\":\"\",\"BSFLD\":\"P0022_ZZSXZY\",\"ZRC_TYPE\":\"major\",\"ZTSGD\":\"\"},{\"FIELD\":\"F1290\",\"FIELN\":\"教育类型\",\"SORTD\":\"40\",\"ZZREQ\":\"X\",\"ZZHID\":\"\",\"ZZDEF\":\"\",\"ZZSHF\":\"T\",\"ZZSHN\":\"ZTJTHRS0007_T\",\"ZZSHM\":\"D\",\"ZZZJL\":\"X\",\"ZZKEY\":\"\",\"ZKJLX\":\"IPT\",\"ZSKEY\":\"AUSBI\",\"ZSVAL\":\"ATEXT\",\"ZSCOD\":\"SLART=F1275\",\"CFIED\":\"\",\"RFIED\":\"AUSBI\",\"ZZBDS\":\"\",\"FTYPE\":\"S\",\"FLENG\":0,\"FDECI\":\"000000\",\"ZZDIS\":\"\",\"ZZCOL\":1,\"RCODE\":\"\",\"ZZDQZ\":\"\",\"ZIFXG\":\"\",\"EVEN\":\"\",\"FFIED\":\"\",\"ZSSQZ\":\"\",\"OFFLD\":\"\",\"BSFLD\":\"JYLX\",\"ZRC_TYPE\":\"ZHRJYLX\",\"ZTSGD\":\"\"},{\"FIELD\":\"F1295\",\"FIELN\":\"学习形式\",\"SORTD\":\"45\",\"ZZREQ\":\"X\",\"ZZHID\":\"\",\"ZZDEF\":\"\",\"ZZSHF\":\"T\",\"ZZSHN\":\"ZTJTHRS0007_T\",\"ZZSHM\":\"D\",\"ZZZJL\":\"X\",\"ZZKEY\":\"\",\"ZKJLX\":\"IPT\",\"ZSKEY\":\"ZHRXXXS\",\"ZSVAL\":\"ZHRXXXSTX\",\"ZSCOD\":\"SLART=F1275;AUSBI=F1290\",\"CFIED\":\"\",\"RFIED\":\"ZHRXXXS\",\"ZZBDS\":\"\",\"FTYPE\":\"S\",\"FLENG\":0,\"FDECI\":\"000000\",\"ZZDIS\":\"\",\"ZZCOL\":1,\"RCODE\":\"\",\"ZZDQZ\":\"\",\"ZIFXG\":\"\",\"EVEN\":\"\",\"FFIED\":\"\",\"ZSSQZ\":\"\",\"OFFLD\":\"\",\"BSFLD\":\"XXXS\",\"ZRC_TYPE\":\"ZXXXS\",\"ZTSGD\":\"\"},{\"FIELD\":\"F1296\",\"FIELN\":\"学位名称\",\"SORTD\":\"46\",\"ZZREQ\":\"X\",\"ZZHID\":\"\",\"ZZDEF\":\"\",\"ZZSHF\":\"T\",\"ZZSHN\":\"ZHRXWMCB\",\"ZZSHM\":\"D\",\"ZZZJL\":\"X\",\"ZZKEY\":\"\",\"ZKJLX\":\"IPT\",\"ZSKEY\":\"ZHRXWMC\",\"ZSVAL\":\"ZHRXWMCWB\",\"ZSCOD\":\"SLART=F1275;AUSBI=F1290\",\"CFIED\":\"\",\"RFIED\":\"ZHRXWMC\",\"ZZBDS\":\"\",\"FTYPE\":\"S\",\"FLENG\":0,\"FDECI\":\"000000\",\"ZZDIS\":\"\",\"ZZCOL\":1,\"RCODE\":\"\",\"ZZDQZ\":\"\",\"ZIFXG\":\"\",\"EVEN\":\"\",\"FFIED\":\"\",\"ZSSQZ\":\"\",\"OFFLD\":\"\",\"BSFLD\":\"DEGREE\",\"ZRC_TYPE\":\"ZHRXW\",\"ZTSGD\":\"\"},{\"FIELD\":\"F1300\",\"FIELN\":\"证书\",\"SORTD\":\"50\",\"ZZREQ\":\"X\",\"ZZHID\":\"\",\"ZZDEF\":\"\",\"ZZSHF\":\"T\",\"ZZSHN\":\"ZTJTHRS0007_T\",\"ZZSHM\":\"D\",\"ZZZJL\":\"X\",\"ZZKEY\":\"\",\"ZKJLX\":\"IPT\",\"ZSKEY\":\"SLABS\",\"ZSVAL\":\"ZHR_TEXT\",\"ZSCOD\":\"SLART=F1275;AUSBI=F1290;ZHRXXXS=F1295\",\"CFIED\":\"\",\"RFIED\":\"SLABS\",\"ZZBDS\":\"\",\"FTYPE\":\"S\",\"FLENG\":0,\"FDECI\":\"000000\",\"ZZDIS\":\"\",\"ZZCOL\":1,\"RCODE\":\"\",\"ZZDQZ\":\"\",\"ZIFXG\":\"\",\"EVEN\":\"\",\"FFIED\":\"\",\"ZSSQZ\":\"\",\"OFFLD\":\"\",\"BSFLD\":\"ZS\",\"ZRC_TYPE\":\"certificat\",\"ZTSGD\":\"\"},{\"FIELD\":\"F1305\",\"FIELN\":\"学历证书编号(高中及以下可填0000)\",\"SORTD\":\"50\",\"ZZREQ\":\"X\",\"ZZHID\":\"\",\"ZZDEF\":\"\",\"ZZSHF\":\"\",\"ZZSHN\":\"\",\"ZZSHM\":\"\",\"ZZZJL\":\"\",\"ZZKEY\":\"\",\"ZKJLX\":\"IPT\",\"ZSKEY\":\"\",\"ZSVAL\":\"\",\"ZSCOD\":\"\",\"CFIED\":\"\",\"RFIED\":\"ZHRXLZSBH\",\"ZZBDS\":\"\",\"FTYPE\":\"C\",\"FLENG\":30,\"FDECI\":\"000000\",\"ZZDIS\":\"\",\"ZZCOL\":1,\"RCODE\":\"\",\"ZZDQZ\":\"\",\"ZIFXG\":\"\",\"EVEN\":\"\",\"FFIED\":\"\",\"ZSSQZ\":\"\",\"OFFLD\":\"\",\"BSFLD\":\"BYZSBH\",\"ZRC_TYPE\":\"\",\"ZTSGD\":\"\"}],\"VALUE\":\"\",\"ZSSQZ\":\"\",\"ZZHID\":\"\"}"),
            // 工作经历
            JSON.parseObject("{\"INFTY\":\"0023\",\"SUBTY\":\"\",\"INFTX\":\"工作经历(注意：如每段经历之间超三个月，请补充一段经历，公司名称及职位填写“待业”，证明人填自己，其他字段填“无”)\",\"SORTD\":\"10\",\"ACTIO\":\"INS\",\"ZZREQ\":\"\",\"ZZTAB\":\"X\",\"ZZLST\":\"\",\"XXCOL\":4,\"BSFLD\":\"WORKING_EXPERIENCE\",\"FIELD\":[{\"FIELD\":\"F1450\",\"FIELN\":\"开始时间\",\"SORTD\":\"03\",\"ZZREQ\":\"X\",\"ZZHID\":\"\",\"ZZDEF\":\"\",\"ZZSHF\":\"\",\"ZZSHN\":\"\",\"ZZSHM\":\"\",\"ZZZJL\":\"\",\"ZZKEY\":\"\",\"ZKJLX\":\"IPT\",\"ZSKEY\":\"\",\"ZSVAL\":\"\",\"ZSCOD\":\"\",\"CFIED\":\"\",\"RFIED\":\"BEGDA\",\"ZZBDS\":\"\",\"FTYPE\":\"D\",\"FLENG\":8,\"FDECI\":\"000000\",\"ZZDIS\":\"\",\"ZZCOL\":1,\"RCODE\":\"\",\"ZZDQZ\":\"\",\"ZIFXG\":\"\",\"EVEN\":\"\",\"FFIED\":\"\",\"ZSSQZ\":\"\",\"OFFLD\":\"\",\"BSFLD\":\"P0023_BEGDA\",\"ZRC_TYPE\":\"\",\"ZTSGD\":\"\"},{\"FIELD\":\"F1455\",\"FIELN\":\"结束时间\",\"SORTD\":\"06\",\"ZZREQ\":\"X\",\"ZZHID\":\"\",\"ZZDEF\":\"\",\"ZZSHF\":\"\",\"ZZSHN\":\"\",\"ZZSHM\":\"\",\"ZZZJL\":\"\",\"ZZKEY\":\"\",\"ZKJLX\":\"IPT\",\"ZSKEY\":\"\",\"ZSVAL\":\"\",\"ZSCOD\":\"\",\"CFIED\":\"\",\"RFIED\":\"ENDDA\",\"ZZBDS\":\"\",\"FTYPE\":\"D\",\"FLENG\":8,\"FDECI\":\"000000\",\"ZZDIS\":\"\",\"ZZCOL\":1,\"RCODE\":\"\",\"ZZDQZ\":\"\",\"ZIFXG\":\"\",\"EVEN\":\"\",\"FFIED\":\"\",\"ZSSQZ\":\"\",\"OFFLD\":\"\",\"BSFLD\":\"P0023_ENDDA\",\"ZRC_TYPE\":\"\",\"ZTSGD\":\"\"},{\"FIELD\":\"F1410\",\"FIELN\":\"企业名称\",\"SORTD\":\"10\",\"ZZREQ\":\"X\",\"ZZHID\":\"\",\"ZZDEF\":\"\",\"ZZSHF\":\"\",\"ZZSHN\":\"\",\"ZZSHM\":\"\",\"ZZZJL\":\"\",\"ZZKEY\":\"\",\"ZKJLX\":\"IPT\",\"ZSKEY\":\"\",\"ZSVAL\":\"\",\"ZSCOD\":\"\",\"CFIED\":\"\",\"RFIED\":\"ARBGB\",\"ZZBDS\":\"\",\"FTYPE\":\"C\",\"FLENG\":60,\"FDECI\":\"000000\",\"ZZDIS\":\"\",\"ZZCOL\":1,\"RCODE\":\"\",\"ZZDQZ\":\"\",\"ZIFXG\":\"\",\"EVEN\":\"\",\"FFIED\":\"\",\"ZSSQZ\":\"\",\"OFFLD\":\"\",\"BSFLD\":\"P0023_ARBGB\",\"ZRC_TYPE\":\"\",\"ZTSGD\":\"\"},{\"FIELD\":\"F1415\",\"FIELN\":\"公司介绍\",\"SORTD\":\"15\",\"ZZREQ\":\"\",\"ZZHID\":\"\",\"ZZDEF\":\"\",\"ZZSHF\":\"\",\"ZZSHN\":\"\",\"ZZSHM\":\"\",\"ZZZJL\":\"\",\"ZZKEY\":\"\",\"ZKJLX\":\"IPT\",\"ZSKEY\":\"\",\"ZSVAL\":\"\",\"ZSCOD\":\"\",\"CFIED\":\"\",\"RFIED\":\"ZHRGSJS\",\"ZZBDS\":\"\",\"FTYPE\":\"C\",\"FLENG\":100,\"FDECI\":\"000000\",\"ZZDIS\":\"\",\"ZZCOL\":1,\"RCODE\":\"\",\"ZZDQZ\":\"\",\"ZIFXG\":\"X\",\"EVEN\":\"\",\"FFIED\":\"\",\"ZSSQZ\":\"\",\"OFFLD\":\"\",\"BSFLD\":\"COMPANYSIZE\",\"ZRC_TYPE\":\"\",\"ZTSGD\":\"\"},{\"FIELD\":\"F1420\",\"FIELN\":\"所在部门\",\"SORTD\":\"20\",\"ZZREQ\":\"\",\"ZZHID\":\"\",\"ZZDEF\":\"\",\"ZZSHF\":\"\",\"ZZSHN\":\"\",\"ZZSHM\":\"\",\"ZZZJL\":\"\",\"ZZKEY\":\"\",\"ZKJLX\":\"IPT\",\"ZSKEY\":\"\",\"ZSVAL\":\"\",\"ZSCOD\":\"\",\"CFIED\":\"\",\"RFIED\":\"ZHRGZJLBM\",\"ZZBDS\":\"\",\"FTYPE\":\"C\",\"FLENG\":60,\"FDECI\":\"000000\",\"ZZDIS\":\"\",\"ZZCOL\":1,\"RCODE\":\"\",\"ZZDQZ\":\"\",\"ZIFXG\":\"\",\"EVEN\":\"\",\"FFIED\":\"\",\"ZSSQZ\":\"\",\"OFFLD\":\"\",\"BSFLD\":\"DEPARTMENT\",\"ZRC_TYPE\":\"\",\"ZTSGD\":\"\"},{\"FIELD\":\"F1425\",\"FIELN\":\"职位名称\",\"SORTD\":\"25\",\"ZZREQ\":\"X\",\"ZZHID\":\"\",\"ZZDEF\":\"\",\"ZZSHF\":\"\",\"ZZSHN\":\"\",\"ZZSHM\":\"\",\"ZZZJL\":\"\",\"ZZKEY\":\"\",\"ZKJLX\":\"IPT\",\"ZSKEY\":\"\",\"ZSVAL\":\"\",\"ZSCOD\":\"\",\"CFIED\":\"\",\"RFIED\":\"ZHRZWZW\",\"ZZBDS\":\"\",\"FTYPE\":\"C\",\"FLENG\":100,\"FDECI\":\"000000\",\"ZZDIS\":\"\",\"ZZCOL\":1,\"RCODE\":\"\",\"ZZDQZ\":\"\",\"ZIFXG\":\"\",\"EVEN\":\"\",\"FFIED\":\"\",\"ZSSQZ\":\"\",\"OFFLD\":\"\",\"BSFLD\":\"P0023_ZZW\",\"ZRC_TYPE\":\"\",\"ZTSGD\":\"\"},{\"FIELD\":\"F1430\",\"FIELN\":\"下属人数\",\"SORTD\":\"30\",\"ZZREQ\":\"X\",\"ZZHID\":\"\",\"ZZDEF\":\"\",\"ZZSHF\":\"\",\"ZZSHN\":\"\",\"ZZSHM\":\"\",\"ZZZJL\":\"\",\"ZZKEY\":\"\",\"ZKJLX\":\"IPT\",\"ZSKEY\":\"\",\"ZSVAL\":\"\",\"ZSCOD\":\"\",\"CFIED\":\"\",\"RFIED\":\"ZHRXSRS\",\"ZZBDS\":\"\",\"FTYPE\":\"C\",\"FLENG\":100,\"FDECI\":\"000000\",\"ZZDIS\":\"\",\"ZZCOL\":1,\"RCODE\":\"\",\"ZZDQZ\":\"\",\"ZIFXG\":\"X\",\"EVEN\":\"\",\"FFIED\":\"\",\"ZSSQZ\":\"\",\"OFFLD\":\"\",\"BSFLD\":\"\",\"ZRC_TYPE\":\"\",\"ZTSGD\":\"\"},{\"FIELD\":\"F1435\",\"FIELN\":\"汇报对象\",\"SORTD\":\"35\",\"ZZREQ\":\"X\",\"ZZHID\":\"\",\"ZZDEF\":\"\",\"ZZSHF\":\"\",\"ZZSHN\":\"\",\"ZZSHM\":\"\",\"ZZZJL\":\"\",\"ZZKEY\":\"\",\"ZKJLX\":\"IPT\",\"ZSKEY\":\"\",\"ZSVAL\":\"\",\"ZSCOD\":\"\",\"CFIED\":\"\",\"RFIED\":\"ZHRHBDX\",\"ZZBDS\":\"\",\"FTYPE\":\"C\",\"FLENG\":100,\"FDECI\":\"000000\",\"ZZDIS\":\"\",\"ZZCOL\":1,\"RCODE\":\"\",\"ZZDQZ\":\"\",\"ZIFXG\":\"X\",\"EVEN\":\"\",\"FFIED\":\"\",\"ZSSQZ\":\"\",\"OFFLD\":\"\",\"BSFLD\":\"\",\"ZRC_TYPE\":\"\",\"ZTSGD\":\"\"},{\"FIELD\":\"F1440\",\"FIELN\":\"工作城市\",\"SORTD\":\"40\",\"ZZREQ\":\"\",\"ZZHID\":\"\",\"ZZDEF\":\"\",\"ZZSHF\":\"\",\"ZZSHN\":\"\",\"ZZSHM\":\"\",\"ZZZJL\":\"\",\"ZZKEY\":\"\",\"ZKJLX\":\"IPT\",\"ZSKEY\":\"\",\"ZSVAL\":\"\",\"ZSCOD\":\"\",\"CFIED\":\"\",\"RFIED\":\"ORT01\",\"ZZBDS\":\"\",\"FTYPE\":\"C\",\"FLENG\":25,\"FDECI\":\"000000\",\"ZZDIS\":\"\",\"ZZCOL\":1,\"RCODE\":\"\",\"ZZDQZ\":\"\",\"ZIFXG\":\"\",\"EVEN\":\"\",\"FFIED\":\"\",\"ZSSQZ\":\"\",\"OFFLD\":\"\",\"BSFLD\":\"\",\"ZRC_TYPE\":\"\",\"ZTSGD\":\"\"},{\"FIELD\":\"F1460\",\"FIELN\":\"证明人姓名\",\"SORTD\":\"60\",\"ZZREQ\":\"X\",\"ZZHID\":\"\",\"ZZDEF\":\"\",\"ZZSHF\":\"\",\"ZZSHN\":\"\",\"ZZSHM\":\"\",\"ZZZJL\":\"\",\"ZZKEY\":\"\",\"ZKJLX\":\"IPT\",\"ZSKEY\":\"\",\"ZSVAL\":\"\",\"ZSCOD\":\"\",\"CFIED\":\"\",\"RFIED\":\"ZHRGZJLZMR\",\"ZZBDS\":\"\",\"FTYPE\":\"C\",\"FLENG\":20,\"FDECI\":\"000000\",\"ZZDIS\":\"\",\"ZZCOL\":1,\"RCODE\":\"\",\"ZZDQZ\":\"\",\"ZIFXG\":\"\",\"EVEN\":\"\",\"FFIED\":\"\",\"ZSSQZ\":\"\",\"OFFLD\":\"\",\"BSFLD\":\"\",\"ZRC_TYPE\":\"\",\"ZTSGD\":\"\"},{\"FIELD\":\"F1465\",\"FIELN\":\"证明人电话\",\"SORTD\":\"65\",\"ZZREQ\":\"\",\"ZZHID\":\"\",\"ZZDEF\":\"\",\"ZZSHF\":\"\",\"ZZSHN\":\"\",\"ZZSHM\":\"\",\"ZZZJL\":\"\",\"ZZKEY\":\"\",\"ZKJLX\":\"IPT\",\"ZSKEY\":\"\",\"ZSVAL\":\"\",\"ZSCOD\":\"\",\"CFIED\":\"\",\"RFIED\":\"ZHRGZJLZMRDH\",\"ZZBDS\":\"\",\"FTYPE\":\"C\",\"FLENG\":20,\"FDECI\":\"000000\",\"ZZDIS\":\"\",\"ZZCOL\":1,\"RCODE\":\"\",\"ZZDQZ\":\"\",\"ZIFXG\":\"\",\"EVEN\":\"\",\"FFIED\":\"\",\"ZSSQZ\":\"\",\"OFFLD\":\"\",\"BSFLD\":\"\",\"ZRC_TYPE\":\"\",\"ZTSGD\":\"\"},{\"FIELD\":\"F1466\",\"FIELN\":\"是否虚拟（待业工作经历请选是）\",\"SORTD\":\"66\",\"ZZREQ\":\"X\",\"ZZHID\":\"X\",\"ZZDEF\":\"\",\"ZZSHF\":\"D\",\"ZZSHN\":\"ZDHR_XFELD\",\"ZZSHM\":\"D\",\"ZZZJL\":\"\",\"ZZKEY\":\"\",\"ZKJLX\":\"IPT\",\"ZSKEY\":\"\",\"ZSVAL\":\"\",\"ZSCOD\":\"\",\"CFIED\":\"\",\"RFIED\":\"ZHRSFXN\",\"ZZBDS\":\"\",\"FTYPE\":\"S\",\"FLENG\":0,\"FDECI\":\"000000\",\"ZZDIS\":\"\",\"ZZCOL\":1,\"RCODE\":\"\",\"ZZDQZ\":\"\",\"ZIFXG\":\"\",\"EVEN\":\"\",\"FFIED\":\"\",\"ZSSQZ\":\"\",\"OFFLD\":\"\",\"BSFLD\":\"\",\"ZRC_TYPE\":\"\",\"ZTSGD\":\"\"},{\"FIELD\":\"F1445\",\"FIELN\":\"工作职责及业绩\",\"SORTD\":\"70\",\"ZZREQ\":\"X\",\"ZZHID\":\"\",\"ZZDEF\":\"\",\"ZZSHF\":\"\",\"ZZSHN\":\"\",\"ZZSHM\":\"L\",\"ZZZJL\":\"\",\"ZZKEY\":\"\",\"ZKJLX\":\"TXT\",\"ZSKEY\":\"\",\"ZSVAL\":\"\",\"ZSCOD\":\"\",\"CFIED\":\"\",\"RFIED\":\"ZSHR0139-ZHRGZZZ\",\"ZZBDS\":\"\",\"FTYPE\":\"C\",\"FLENG\":2000,\"FDECI\":\"000000\",\"ZZDIS\":\"\",\"ZZCOL\":4,\"RCODE\":\"\",\"ZZDQZ\":\"\",\"ZIFXG\":\"X\",\"EVEN\":\"\",\"FFIED\":\"\",\"ZSSQZ\":\"\",\"OFFLD\":\"\",\"BSFLD\":\"P0023_ZZYZZ\",\"ZRC_TYPE\":\"\",\"ZTSGD\":\"\"}],\"VALUE\":\"\",\"ZSSQZ\":\"\",\"ZZHID\":\"\"}"),

    };

    // 需要格式化sql
    public static String sourceStr = "INSERT INTO ssc.zthr0145 (ZHR_DRMBLX,ZTYPE,FUNC,FIELD,FIELN,ZHR_LW,FTYPE,ZZREQ,CFIED,ZHRZD,ZHR_QSHS,ZHR_DIS,create_date,create_by,last_update_date,last_update_by) VALUES('{MBLX}','{MEMUII}','','{FIELD}','{FIELN}','{columnNum}','{FTYPE}','{ZZREQ}',NULL,NULL,'{startRowNum}',NULL,NULL,NULL,NULL,NULL);";

    // 从第几行开始
    public static int startRowNum = 4;

    /**
     * 生成insert
     */
    private static void generateInsertSql() {
        // 叠加excel行初始位置
        int startIndex = 0;
        for (JSONObject itemAllJson : allJson) {
            JSONArray fieldArray = itemAllJson.getJSONArray("FIELD");
            for (int i = 0; i < fieldArray.size(); i++) {
                JSONObject item = fieldArray.getJSONObject(i);
                Map<Object, Object> obj = new HashMap<>(8);
                // excel标识
                obj.put("MBLX", "RZ01-V2");
                // 菜单
                obj.put("MEMUII", "ZZPGL1");
                // 字段
                obj.put("FIELD", itemAllJson.get("INFTY") + "--" + item.getString("FIELD"));
                // 描述
                obj.put("FIELN", item.getString("FIELN"));
                // excel所在行号
                obj.put("columnNum", startRowNum + i + startIndex);
                // 数据类型
                obj.put("FTYPE", item.getString("FTYPE"));
                // 是否必填
                obj.put("ZZREQ", item.getString("ZZREQ"));
                // 开始行号
                obj.put("startRowNum", startRowNum);
                System.out.println(StrUtil.format(sourceStr, obj));
            }
            startIndex += fieldArray.size() - 1;
        }
    }

    public static void main(String[] args) {
//        generateInsertSql();
        formatJsonField();
    }

    /**
     * 格式化json，只剩FIELD字段
     */
    public static void formatJsonField() {
        JSONArray source = JSON.parseArray("[{\"FUNC\":\"\",\"ZHR_LW\":\"1\",\"FIELD\":\"GUID\",\"FIELN\":\"GUID\",\"id\":0,\"ZTYPE\":\"\"},{\"FUNC\":\"\",\"ZHR_LW\":\"2\",\"FIELD\":\"PERNR\",\"FIELN\":\"工号\",\"id\":0,\"ZTYPE\":\"\"},{\"FUNC\":\"\",\"ZHR_LW\":\"3\",\"FIELD\":\"ENAME\",\"FIELN\":\"员工姓名\",\"id\":0,\"ZTYPE\":\"\"},{\"FIELD\":\"0022--F1260\",\"FIELN\":\"开始时间\",\"FTYPE\":\"D\",\"FUNC\":\"\",\"ZHR_DRMBLX\":\"RZ01-V2\",\"ZHR_LW\":\"4\",\"ZHR_QSHS\":\"4\",\"ZTYPE\":\"ZZPGL1\",\"id\":409},{\"FIELD\":\"0022--F1265\",\"FIELN\":\"结束时间\",\"FTYPE\":\"D\",\"FUNC\":\"\",\"ZHR_DRMBLX\":\"RZ01-V2\",\"ZHR_LW\":\"5\",\"ZHR_QSHS\":\"4\",\"ZTYPE\":\"ZZPGL1\",\"id\":410},{\"FIELD\":\"0022--F1275\",\"FIELN\":\"学历\",\"FTYPE\":\"S\",\"FUNC\":\"\",\"ZHR_DRMBLX\":\"RZ01-V2\",\"ZHR_LW\":\"6\",\"ZHR_QSHS\":\"4\",\"ZTYPE\":\"ZZPGL1\",\"id\":411},{\"FIELD\":\"0022--F1270\",\"FIELN\":\"学校\",\"FTYPE\":\"C\",\"FUNC\":\"\",\"ZHR_DRMBLX\":\"RZ01-V2\",\"ZHR_LW\":\"7\",\"ZHR_QSHS\":\"4\",\"ZTYPE\":\"ZZPGL1\",\"id\":412},{\"FIELD\":\"0022--F1276\",\"FIELN\":\"是否最高学历\",\"FTYPE\":\"S\",\"FUNC\":\"\",\"ZHR_DRMBLX\":\"RZ01-V2\",\"ZHR_LW\":\"8\",\"ZHR_QSHS\":\"4\",\"ZTYPE\":\"ZZPGL1\",\"id\":413},{\"FIELD\":\"0022--F1277\",\"FIELN\":\"是否最高学位\",\"FTYPE\":\"S\",\"FUNC\":\"\",\"ZHR_DRMBLX\":\"RZ01-V2\",\"ZHR_LW\":\"9\",\"ZHR_QSHS\":\"4\",\"ZTYPE\":\"ZZPGL1\",\"id\":414},{\"FIELD\":\"0022--F1278\",\"FIELN\":\"是否初始学历\",\"FTYPE\":\"S\",\"FUNC\":\"\",\"ZHR_DRMBLX\":\"RZ01-V2\",\"ZHR_LW\":\"10\",\"ZHR_QSHS\":\"4\",\"ZTYPE\":\"ZZPGL1\",\"id\":415},{\"FIELD\":\"0022--F1280\",\"FIELN\":\"专业类别\",\"FTYPE\":\"S\",\"FUNC\":\"\",\"ZHR_DRMBLX\":\"RZ01-V2\",\"ZHR_LW\":\"11\",\"ZHR_QSHS\":\"4\",\"ZTYPE\":\"ZZPGL1\",\"id\":416},{\"FIELD\":\"0022--F1285\",\"FIELN\":\"专业名称（初中以上必填）\",\"FTYPE\":\"C\",\"FUNC\":\"\",\"ZHR_DRMBLX\":\"RZ01-V2\",\"ZHR_LW\":\"12\",\"ZHR_QSHS\":\"4\",\"ZTYPE\":\"ZZPGL1\",\"id\":417},{\"FIELD\":\"0022--F1290\",\"FIELN\":\"教育类型\",\"FTYPE\":\"S\",\"FUNC\":\"\",\"ZHR_DRMBLX\":\"RZ01-V2\",\"ZHR_LW\":\"13\",\"ZHR_QSHS\":\"4\",\"ZTYPE\":\"ZZPGL1\",\"id\":418},{\"FIELD\":\"0022--F1295\",\"FIELN\":\"学习形式\",\"FTYPE\":\"S\",\"FUNC\":\"\",\"ZHR_DRMBLX\":\"RZ01-V2\",\"ZHR_LW\":\"14\",\"ZHR_QSHS\":\"4\",\"ZTYPE\":\"ZZPGL1\",\"id\":419},{\"FIELD\":\"0022--F1296\",\"FIELN\":\"学位名称\",\"FTYPE\":\"S\",\"FUNC\":\"\",\"ZHR_DRMBLX\":\"RZ01-V2\",\"ZHR_LW\":\"15\",\"ZHR_QSHS\":\"4\",\"ZTYPE\":\"ZZPGL1\",\"id\":420},{\"FIELD\":\"0022--F1300\",\"FIELN\":\"证书\",\"FTYPE\":\"S\",\"FUNC\":\"\",\"ZHR_DRMBLX\":\"RZ01-V2\",\"ZHR_LW\":\"16\",\"ZHR_QSHS\":\"4\",\"ZTYPE\":\"ZZPGL1\",\"id\":421},{\"FIELD\":\"0022--F1305\",\"FIELN\":\"学历证书编号(高中及以下可填0000)\",\"FTYPE\":\"C\",\"FUNC\":\"\",\"ZHR_DRMBLX\":\"RZ01-V2\",\"ZHR_LW\":\"17\",\"ZHR_QSHS\":\"4\",\"ZTYPE\":\"ZZPGL1\",\"id\":422},{\"FIELD\":\"0023--F1450\",\"FIELN\":\"开始时间\",\"FTYPE\":\"D\",\"FUNC\":\"\",\"ZHR_DRMBLX\":\"RZ01-V2\",\"ZHR_LW\":\"17\",\"ZHR_QSHS\":\"4\",\"ZTYPE\":\"ZZPGL1\",\"id\":423},{\"FIELD\":\"0023--F1455\",\"FIELN\":\"结束时间\",\"FTYPE\":\"D\",\"FUNC\":\"\",\"ZHR_DRMBLX\":\"RZ01-V2\",\"ZHR_LW\":\"18\",\"ZHR_QSHS\":\"4\",\"ZTYPE\":\"ZZPGL1\",\"id\":424},{\"FIELD\":\"0023--F1410\",\"FIELN\":\"企业名称\",\"FTYPE\":\"C\",\"FUNC\":\"\",\"ZHR_DRMBLX\":\"RZ01-V2\",\"ZHR_LW\":\"19\",\"ZHR_QSHS\":\"4\",\"ZTYPE\":\"ZZPGL1\",\"id\":425},{\"FIELD\":\"0023--F1415\",\"FIELN\":\"公司介绍\",\"FTYPE\":\"C\",\"FUNC\":\"\",\"ZHR_DRMBLX\":\"RZ01-V2\",\"ZHR_LW\":\"20\",\"ZHR_QSHS\":\"4\",\"ZTYPE\":\"ZZPGL1\",\"id\":426},{\"FIELD\":\"0023--F1420\",\"FIELN\":\"所在部门\",\"FTYPE\":\"C\",\"FUNC\":\"\",\"ZHR_DRMBLX\":\"RZ01-V2\",\"ZHR_LW\":\"21\",\"ZHR_QSHS\":\"4\",\"ZTYPE\":\"ZZPGL1\",\"id\":427},{\"FIELD\":\"0023--F1425\",\"FIELN\":\"职位名称\",\"FTYPE\":\"C\",\"FUNC\":\"\",\"ZHR_DRMBLX\":\"RZ01-V2\",\"ZHR_LW\":\"22\",\"ZHR_QSHS\":\"4\",\"ZTYPE\":\"ZZPGL1\",\"id\":428},{\"FIELD\":\"0023--F1430\",\"FIELN\":\"下属人数\",\"FTYPE\":\"C\",\"FUNC\":\"\",\"ZHR_DRMBLX\":\"RZ01-V2\",\"ZHR_LW\":\"23\",\"ZHR_QSHS\":\"4\",\"ZTYPE\":\"ZZPGL1\",\"id\":429},{\"FIELD\":\"0023--F1435\",\"FIELN\":\"汇报对象\",\"FTYPE\":\"C\",\"FUNC\":\"\",\"ZHR_DRMBLX\":\"RZ01-V2\",\"ZHR_LW\":\"24\",\"ZHR_QSHS\":\"4\",\"ZTYPE\":\"ZZPGL1\",\"id\":430},{\"FIELD\":\"0023--F1440\",\"FIELN\":\"工作城市\",\"FTYPE\":\"C\",\"FUNC\":\"\",\"ZHR_DRMBLX\":\"RZ01-V2\",\"ZHR_LW\":\"25\",\"ZHR_QSHS\":\"4\",\"ZTYPE\":\"ZZPGL1\",\"id\":431},{\"FIELD\":\"0023--F1460\",\"FIELN\":\"证明人姓名\",\"FTYPE\":\"C\",\"FUNC\":\"\",\"ZHR_DRMBLX\":\"RZ01-V2\",\"ZHR_LW\":\"26\",\"ZHR_QSHS\":\"4\",\"ZTYPE\":\"ZZPGL1\",\"id\":432},{\"FIELD\":\"0023--F1465\",\"FIELN\":\"证明人电话\",\"FTYPE\":\"C\",\"FUNC\":\"\",\"ZHR_DRMBLX\":\"RZ01-V2\",\"ZHR_LW\":\"27\",\"ZHR_QSHS\":\"4\",\"ZTYPE\":\"ZZPGL1\",\"id\":433},{\"FIELD\":\"0023--F1466\",\"FIELN\":\"是否虚拟（待业工作经历请选是）\",\"FTYPE\":\"S\",\"FUNC\":\"\",\"ZHR_DRMBLX\":\"RZ01-V2\",\"ZHR_LW\":\"28\",\"ZHR_QSHS\":\"4\",\"ZTYPE\":\"ZZPGL1\",\"id\":434},{\"FIELD\":\"0023--F1445\",\"FIELN\":\"工作职责及业绩\",\"FTYPE\":\"C\",\"FUNC\":\"\",\"ZHR_DRMBLX\":\"RZ01-V2\",\"ZHR_LW\":\"29\",\"ZHR_QSHS\":\"4\",\"ZTYPE\":\"ZZPGL1\",\"id\":435}]");
        JSONArray target = new JSONArray();
        for (int i = 0; i < source.size(); i++) {
            JSONObject jsonObject = source.getJSONObject(i);
            JSONObject item = new JSONObject();
            item.put("field", jsonObject.getString("FIELD"));
            target.add(item);
        }
        System.out.println(target.toJSONString());
    }


}
